<template>
  <!-- 申请记录 -->
  <div style="padding:20px 20px;" >
      <el-tabs type="border-card" @tab-click="clfn">
        <el-tab-pane label="出库记录"><InandData ref="InandData1"></InandData></el-tab-pane>
        <el-tab-pane label="入库记录"><InandData ref="InandData2"></InandData></el-tab-pane>
      </el-tabs>
  </div>
</template>

<script>

  import InandData from './InandOut_data.vue'
  export default {
    components: {InandData},//声明子组件
    computed:{},
    data(){
      return {
        urlitem:'出库记录',//
      }
    },
    methods:{
      clfn(i){
		 console.log(i)
         this.urlitem = i.label;
		 this.$refs.InandData1.index = 0;//接口参数state的值，0为出库接口，1为入库接口
		 this.$refs.InandData2.index = 1;
		 this.$refs.InandData1.states = true;//子组件物料编码的隐藏和显示
		 this.$refs.InandData2.states = false;
         (i.label==='出库记录')?this.$refs.InandData1.get_data():this.$refs.InandData2.get_data();
      }
    },
    mounted(){
      this.$refs.InandData1.get_data()//获取数据
    },
  }
</script>

<style scoped="scoped">
  .xiu_box{width: 100%;}
  .btn{padding:10px 5px;}

</style>
